Repository navigation
[No QA] feat: add unit tests for edit money request and payment via vbba - #27609
Conversation
|
@thesahindia Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
mountiny
left a comment
There was a problem hiding this comment.
In general this looks great! I think there is more to cover but I think we can have that in a separate issue and this is good starting point for the coverage. I think ideally we can cover all the payment types, editing in multiple ways etc
@allroundexperts however, I am not sure if the workspace test is actually creating a workspace chat and expense report.
And one thing I would add to this PR is to test the MODIFIEDEXPENSE report action is correctly added to the report and that its message is correct change .... or set ... or removed .... Could you add that into this PR please?
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| onyxMethod: Onyx.METHOD.SET, | ||
| key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, | ||
| value: transaction, | ||
| }, | ||
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| onyxMethod: Onyx.METHOD.SET, | ||
| key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`, | ||
| value: iouReport, | ||
| }, | ||
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| onyxMethod: Onyx.METHOD.SET, | ||
| key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.chatReportID}`, | ||
| value: chatReport, | ||
| }, |
There was a problem hiding this comment.
I am not 100% sure this is the best practice, but from this it seems fine to me to use SET
There was a problem hiding this comment.
MERGE merges both previous and the new data. In this case however, we're generating new optimistic objects for transaction, iouReport and chatReport. As such, it makes sense to use SET directly.
There was a problem hiding this comment.
This change caused regression.
Issue -> "IOU - Edited amount for a paid request does not revert to initial amount after closing error message"
| }); | ||
| }); | ||
|
|
||
| describe('edit requestMoney', () => { |
There was a problem hiding this comment.
| describe('edit requestMoney', () => { | |
| describe('edit money request', () => { |
| let chatReport = {}; | ||
|
|
||
| fetch.pause(); | ||
| IOU.requestMoney({}, amount, CONST.CURRENCY.USD, '', merchant, RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment); |
There was a problem hiding this comment.
Is this creating an expense report on workspace chat though? It seems like its the same as the iou report above and we cannot use the VBBA payment type for that
There was a problem hiding this comment.
It wasn't. I have updated it to create a workspace now.
|
@allroundexperts are you bale to address the feedback please? Thanks! |
@mountiny This already exists here. I have added another expect statement that would make it more obvious. As far as the messages are concerned, those are generated in the UI itself instead of being stored in the report action. The tests assert on the report actions and ensure that both the old and new comment are accurate. |
mountiny
left a comment
There was a problem hiding this comment.
Thank you very much @allroundexperts
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.90-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.90-2 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.91-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.91-8 🚀
|
Details
This PR adds unit tests for the Edit money request flow and the payment via ACH flow.
Fixed Issues
$ #26366
PROPOSAL: #26366
Tests
N/A
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
N/A
Mobile Web - Chrome
N/A
Mobile Web - Safari
N/A
Desktop
N/A
iOS
N/A
Android
N/A